package com.bayair.doctor.adapter;

import androidx.annotation.Nullable;

import com.bayair.doctor.R;
import com.bayair.doctor.utils.ColorFromArray;
import com.bayair.doctor.data.bean.Msg;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MsgLeftAdapter extends BaseQuickAdapter<Msg, BaseViewHolder> {

    public MsgLeftAdapter(@Nullable List<Msg> data) {
        super(R.layout.item_msgleft, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Msg item) {
        helper.setText(R.id.tv_msgleft_text, item.text)
                .setText(R.id.tv_msgleft_date, item.data)
                .setBackgroundColor(R.id.rl_msgleft_layout, ColorFromArray.newInstance().getPositionColor(helper.getLayoutPosition()));

    }


}
